<html lang="zh-CN"><head>
<title>国外直邮信息申报</title>
<meta charset="UTF-8">
<meta name="viewport" content=" initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
	<link href="{$Think.config.RESOURCEURL}wx_assets/css/common.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
	<!-- <script src="http://sdk.talkingdata.com/app/h5/v1?appid=DE13C350F41F5DE78FEC51DB5DE730D1&vn=v2&vc=v2"></script> -->
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.1.1.3.min.js{$Think.config.RESOURCE_VER}"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.alert.js{$Think.config.RESOURCE_VER}"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>
	<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/wx_share.js{$Think.config.RESOURCE_VER}"></script>
</head>
<body>
<style>
	@font-face {
		font-family: 'iconfont';
		src: url('//at.alicdn.com/t/font_1460814243_0836377.eot'); /* IE9*/
		src: url('//at.alicdn.com/t/font_1460814243_0836377.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
		url('//at.alicdn.com/t/font_1460814243_0836377.woff') format('woff'), /* chrome、firefox */
		url('//at.alicdn.com/t/font_1460814243_0836377.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
		url('//at.alicdn.com/t/font_1460814243_0836377.svg#iconfont') format('svg'); /* iOS 4.1- */
	}
	.iconfont {
		font-family:iconfont !important;
	}
	body{background-color: #F5F5F5;font-size:16px;color:#333333}
	.info{
		background-color:white;
	}
	.info>div{
		height:40px;
		line-height:40px;
		border-bottom:1px solid #CCCCCC;
		padding:0 10px;
	}
	.info>div:last-child{
		border:none;
	}
	.top{
		height:40px;
		line-height:40px;
		display: -webkit-box;
		text-align: center;
		-webkit-box-pack: justify;
		background-color:white;
		margin-top:10px;
	}
	.top span,.top a{
		display:block;
	}
	.info>div input{
		width: 60%;
		float: right;
	}
	.explain{
		padding:0 10px;
		line-height: 25px;
		margin-top:30px;
		font-size:14px;
	}
	.explain dt{
		text-align:center;
		color:{$mallHue.fontColor||default='#F75493'};
	}
	.explain dd{
		margin-top:10px;
	}
	.bottom{
		padding: 10px 10px 20px;
	}
	.bottom a{
		height:37px;
		line-height:37px;
		display:block;
		border-radius:4px;
		background-color:{$mallHue.mainColor||default='#F75493'};
		color:white;
		text-align: center;
	}
</style>
	<input type="hidden" value="{$oid}" id="oid"/>
	<div class="info">
		<div class="top">
			<i class="iconfont back" onclick="realInfo._back()">&#xe603;</i>
			<span>完善个人信息</span>
			<a id="SaveBtn">完成</a>
		</div>
		<div>
			<if condition="$IDName eq ''">
				<label>*真实姓名</label><input type="text" placeholder="请填写真实姓名" value="{$fullName}" id="IDName"/>
				<else/>
				<label>*真实姓名</label><input type="text" placeholder="请填写真实姓名" value="{$IDName}" id="IDName"/>
			</if>

		</div>
		<div>
			<label>*身份证号</label><input type="text" placeholder="请填写正确的身份证号" value="{$IDNumber}" id="IDNumber"/>
		</div>
	</div>
<style>
	.IDImg{
		background-color:white;
		padding:10px 0;
		margin-top:10px;
	}
	.IDImg>span{
		line-height:30px;
		padding:0 10px;
		display:block;
	}
	.IDImg>ul{
		height:90px;
		display:-webkit-box;
		-webkit-box-pack:justify;
	}
	.IDImg>ul>li{
		-webkit-box-flex: 1;
		height:100%;
		padding:10px 5px 10px 10px;
		box-sizing: border-box;
	}
	.IDImg>ul>li:last-child{
		padding:10px 10px 10px 5px;
	}
	.IDImg>ul>li>a{
		display:block;
		width:100%;
		height:100%;
		border:1px solid #F1F0F8;
		border-radius:5px;
		position:relative;
		text-align: center;
		font-size:0;
		overflow: hidden;
	}
	.IDImg>ul>li>a.up:before{
		content:"";
		width:34px;
		height:2px;
		border-radius:2px;
		background-color:#A1A0A0;
		position:absolute;
		top:50%;
		left:50%;
		transfrom:translate(-50%,-50%);
		-webkit-transform: translate(-50%,-50%);
	}
	.IDImg>ul>li>a.up:after{
		content:"";
		height:34px;
		width:2px;
		border-radius:2px;
		background-color:#A1A0A0;
		position:absolute;
		top:50%;
		left:50%;
		transfrom:translate(-50%,-50%);
		-webkit-transform: translate(-50%,-50%);
	}
	.IDImg>ul>li>a>img{
		display:none;
		max-height:100%;
		position:absolute;
		top:50%;
		transform:translate(-50%,-50%);
		-webkit-transform: translate(-50%,-50%);
	}
</style>
	<div class="IDImg">
		<span>请上传身份证正、反面图</span>
		<ul>
			<li>
				<if condition="$IDPositive neq ''">
					<a class="upload"><img style="display:inline-block" src="{$IDPositive}@!ID_watermark" data-img="{$IDPositive}"/></a>
					<else/>
					<a class="up upload"><img src="" /></a>
				</if>
			</li>
			<li>
				<if condition="$IDBack neq ''">
					<a class="upload"><img style="display:inline-block" src="{$IDBack}@!ID_watermark" data-img="{$IDBack}"/></a>
					<else/>
					<a class="up upload"><img src="" /></a>
				</if>
			</li>
		</ul>
	</div>
	<div class="explain">
		<dl>
			<dt>
				请您如实填写身份信息，否则会导致无法正常通关！
			</dt>
			<dd>
				提示：
			</dd>
			<dd>
				1.由于通关要求，保税仓及海外直邮的商品均需要填写身份证信息，需要提供您的身份证号和对应的真实姓名，并确保收货人姓名与身份证姓名保持一致。
			</dd>
			<dd>
				2.您所提供的个人身份信息仅用于商品清关入境需要，不作其它用途使用。
			</dd>
			<dd>
				3.本平台将对您的个人身份信息进行严格的管理及保护，防止您的个人信息泄露。
			</dd>
		</dl>
	</div>
	<div class="bottom">
		<a id="saveBtn">完成</a>
	</div>
</body>
<script>
	var baseUrl = '{$Think.config.SERVER_HOST}';
	var realInfo = {
		init:function(){
			this._initEvent();
		},
		_initEvent:function(){
			var me = this;
			$("#saveBtn,#SaveBtn").click(function(){
				var IDName = $.trim($("#IDName").val());
				var IDNumber = $.trim($("#IDNumber").val());
				var IDPositive = $.trim($(".upload:eq(0)").find("img").data("img"));
				var IDBack = $.trim($(".upload:eq(1)").find("img").data("img"));
				if(IDName==''||IDNumber==''){
					$.util.alert("购买海外商品需要提交真实的身份证信息，海关叔叔才会放行哦");
					return false;
				}
				var reg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
				if(IDNumber.match(reg)==null){
					$.util.alert("身份证号码输入有误");
					return false;
				}
//				if(!IDPositive||!IDBack){
//					$.util.alert("请上传身份证正、反面图");
//					return false;
//				}
				if(IDName&&IDNumber){
					var p = {
						"userName":'{$userName}',
						"IDName":IDName,
						"IDNumber":IDNumber,
						"IDPositive":IDPositive,
						"IDBack":IDBack
					};
					$.util.pageLoading.show();
					$.req.get("call.json?customerId={$customerId}&module=product&method=updateUserInfo",{
						params:p
					},function(data){
						me._back();
					});
				}else{
					$.util.alert("请填写真实信息");
					return;
				}

			});
			$(".upload").click(function(){
				var upload = $(this);
				var img = upload.find('img');
				wx_share.uploadImage(function(data){
					img.attr("src",data.path+"@!ID_watermark").show();
					img.data("img",data.path);
					upload.removeClass("up");
				});
			});
		},
		_back:function(){
			var params = {
				"tplid":1,
				"type":"buy",
				"id":"{$oid}"
			};
			var hrefPath = 'call.html?customerId={$customerId}';
			var url = '&module=product&method=getOrderDetail&force=1&params=';
			url = url + JSON.stringify(params);
			location.href = hrefPath + url;
		}
	}
	realInfo.init();
</script>
<script>
	wx_share.init({
		"pkg":{
			"appId": '{$pkg.appId}',
			"timestamp": '{$pkg.timestamp}',
			"nonceStr": '{$pkg.nonceStr}',
			"signature": '{$pkg.signature}'
		},
		hide:1
	});
</script>
</html>